home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-03 | 4.4 KB | 99 lines | [TEXT/PJMM] |
- unit ICAPI;
-
- interface
-
- uses
- {$ifc undefined THINK_Pascal}
- Types, Files,
- {$endc}
- ICTypes;
-
- function ICStart (var inst: ICInstance; creator: OSType): ICError;
- (* call at application initialisation *)
-
- function ICStop (inst: ICInstance): ICError;
- (* call at application termination *)
-
- function ICFindConfigFile (inst: ICInstance; count: integer; folders: ICDirSpecArrayPtr): ICError;
- (* count is the number of ICDirSpecs that are valid in folders *)
- (* searches the specified folders first, then backs out to preferences folder *)
- (* don't you worry about how it finds the file (; *)
- (* you can pass nil to folders if count is 0 *)
-
- function ICSpecifyConfigFile (inst: ICInstance; config: FSSpec): ICError;
- (* for use *only* by Internet Configuration application *)
-
- function ICGetSeed (inst: ICInstance; var seed: longint): ICError;
- (* returns current seed for prefs file *)
- (* this seed changes every time a preference is modified *)
- (* poll this to detect preference changes by other applications *)
-
- function ICGetPerm (inst: ICInstance; var perm: ICPerm): ICError;
- (* returns the permissions currently associated with this file *)
- (* mainly used by overriding components, applications normally *)
- (* know what permissions they have *)
-
- function ICBegin (inst: ICInstance; perm: ICPerm): ICError;
- (* start reading/writing the preferences *)
- (* must be balanaced by a ICEnd *)
- (* do not call WaitNextEvent between this pair *)
- (* specify either icReadOnlyPerm or icReadWritePerm *)
- (* note that this may open resource files and leave them open until ICEnd *)
-
- function ICGetPref (inst: ICInstance; key: Str255; var attr: ICAttr; buf: Ptr; var size: longint): ICError;
- (* this routine may be called without a ICBegin/ICEnd pair, in which case *)
- (* it implicitly calls ICBegin(inst, icReadOnlyPerm *)
- (* given a key string, returns the attributes and the (optionally) the data for a preference *)
- (* key must not be the empty string *)
- (* if buf is nil then no data fetched and incoming size is ignored*)
- (* size must be non-negative, is size of allocated space for data at buf *)
- (* attr and size and always set on return *)
- (* size is actual size of data (if key present) *)
- (* attr is pref attributes *)
- (* if icTruncatedErr then everything is valid, except you lost some data, size is size of real data*)
- (* on other errors, attr is ICattr_no_change and size is 0 *)
-
- function ICSetPref (inst: ICInstance; key: Str255; attr: ICAttr; buf: Ptr; size: longint): ICError;
- (* this routine may be called without a ICBegin/ICEnd pair, in which case *)
- (* it implicitly calls ICBegin(inst, icReadWritePerm *)
- (* given a key string, sets the attributes and the data for a preference (either is optional) *)
- (* key must not be the empty string *)
- (* if buf is nil then no data stored and size is ignored, used for setting attr *)
- (* size must be non-negative, is size of the data at buf to store *)
- (* icPermErr if ICBegin was given icReadOnlyPerm *)
- (* icPermErr if current attr is locked, new attr is locked and buf <> nil *)
-
- function ICCountPref (inst: ICInstance; var count: longint): ICError;
- (* count total number of preferences *)
- (* if error then count is 0 *)
-
- function ICGetIndPref (inst: ICInstance; n: longint; var key: Str255): ICError;
- (* return the key of the Nth preference *)
- (* n must be positive *)
- (* icPrefNotFoundErr if n is beyond the last preference *)
-
- function ICDeletePref (inst: ICInstance; key: Str255): ICError;
- (* delete the preference specified by key *)
- (* key must not be the empty string *)
- (* preference specified by key must be present *)
- (* icPrefNotFoundErr if it isn't *)
-
- function ICEnd (inst: ICInstance): ICError;
- (* stop reading/writing the preferences *)
-
- function ICDefaultFileName (inst: ICInstance; var name: Str63): ICError;
- (* return the default file name *)
- (* the component calls this routine to set up the default internet configuration file name*)
- (* this allows this operation to be intercepted by a component that has captured us *)
- (* it currently gets it from the component resource file *)
- (* the glue version is hardwired *)
-
- function ICGetComponentInstance (inst: ICInstance; var component_inst: univ Ptr): ICError;
- (* returns noErr and the component instance that we're talking to, if we're using the component *)
- (* returns an error and nil if we're doing it with glue *)
- (* univ Ptr rather than ComponentInstance so that you don't need Components.p *)
- (* in order to use this file *)
-
- implementation
- end. (* ICAPI *)
-